package a.f.l.a;

import a.c.e;
import a.c.z;
import a.d.t;
import a.d.w;
import a.f.ad;

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

class vb
  extends sb
{
  private static final double f = 1.0E-006D;
  private int g;
  private e h;
  private e i;
  private t j;
  private t l;
  private a.f.c.h m;
  private boolean n;
  
  protected void c()
  {
    super.c();
    this.h = null;
    this.i = null;
    this.j = null;
    this.l = null;
    this.m = null;
  }
  
  protected void a(qb paramqb)
  {
    super.a(paramqb);
    this.m = paramqb.b();
  }
  
  protected void b(rb paramrb)
  {
    boolean bool = sb.e;
    super.b(paramrb);
    this.g = paramrb.e().f().c();
    if (!bool) {}
    this.n = (this.g > 0);
    if (!bool)
    {
      if (this.n)
      {
        this.h = paramrb.d().e();
        this.i = paramrb.d().f();
        this.j = paramrb.g().h();
      }
    }
    else {
      this.l = paramrb.i().h();
    }
  }
  
  protected double a(h paramh)
  {
    if (!this.n) {
      return 0.0D;
    }
    double d = 0.0D;
    if ((sb.e) || (paramh.b() != null))
    {
      mb localmb1 = paramh.a();
      mb localmb2 = paramh.b().a();
      z localz1 = new z(b(localmb2));
      z localz2 = new z(b(localmb1));
      if (a(paramh.b(), localz1, localz2)) {
        d += this.g;
      }
    }
    return d;
  }
  
  double[] a(h paramh, mb parammb, jb[] paramArrayOfjb, m[] paramArrayOfm, double[] paramArrayOfDouble)
  {
    boolean bool = sb.e;
    if (!bool)
    {
      if (!this.n) {
        b("punish node crossing", 0.0D, false);
      }
    }
    else {
      return new double[paramArrayOfjb.length];
    }
    double d = 0.0D;
    if (!bool) {
      if (a(paramh, parammb)) {
        d = this.g;
      }
    }
    double[] arrayOfDouble = new double[paramArrayOfjb.length];
    if (!bool)
    {
      if (d > 0.0D) {
        Arrays.fill(arrayOfDouble, d);
      }
      b("punish node crossing", d, false);
    }
    return arrayOfDouble;
  }
  
  private boolean a(mb parammb)
  {
    Iterator localIterator = b(parammb).iterator();
    while (localIterator.hasNext())
    {
      e locale = (e)localIterator.next();
      if ((!this.m.e(locale)) && (locale != this.h)) {
        return true;
      }
    }
    return false;
  }
  
  private boolean a(h paramh, mb parammb)
  {
    mb localmb = paramh.a();
    List localList1 = b(localmb);
    List localList2 = b(parammb);
    return a(paramh, localList1, localList2);
  }
  
  private boolean a(h paramh, List paramList1, List paramList2)
  {
    boolean bool = sb.e;
    e locale1 = a(paramList1, paramList2);
    if (!bool) {
      if (locale1 != null)
      {
        if (bool) {
          break label54;
        }
        if (!a(locale1))
        {
          if (bool) {
            break label54;
          }
          if (!b(locale1)) {
            return true;
          }
        }
      }
    }
    label54:
    e locale2 = b(paramList1, paramList2);
    if (locale2 != null)
    {
      if (!bool) {
        if (!a(locale2)) {
          if (bool) {
            break label95;
          }
        }
      }
      label95:
      int k = b(locale2) ? 1 : 0;
      if (!bool) {
        if (k == 0) {
          return false;
        }
      }
      if (!bool) {
        if (!d(paramh)) {
          return false;
        }
      }
      return true;
    }
    return false;
  }
  
  private boolean d(h paramh)
  {
    boolean bool3 = sb.e;
    int k = sb.d;
    boolean bool1 = true;
    boolean bool2 = true;
    h localh = paramh;
    do
    {
      while (k == 0)
      {
        if (!bool1)
        {
          if (k != 0) {
            break label88;
          }
          if (!bool2) {
            break;
          }
        }
        if (!bool3)
        {
          if (localh == null) {
            break;
          }
          bool1 &= b().b(localh.a());
          bool2 &= b().d(localh.a());
        }
        localh = localh.b();
      }
    } while (bool3);
    if (!bool1) {
      label88:
      if (bool3) {}
    }
    return !bool2;
  }
  
  private boolean a(e parame)
  {
    return a(this.l, parame);
  }
  
  private boolean b(e parame)
  {
    boolean bool = sb.e;
    int k = sb.d;
    r localr = a().a(b().d());
    List localList = localr.e(false);
    if (!localList.isEmpty())
    {
      t localt = a().a().v(parame);
      Iterator localIterator = localList.iterator();
      while (localIterator.hasNext())
      {
        ad localad = (ad)localIterator.next();
        w localw = localr.a(localad, false);
        if (localt.a(localw))
        {
          if ((bool) || (k != 0)) {
            break label115;
          }
          return true;
        }
      }
    }
    label115:
    return false;
  }
  
  private boolean d(e parame)
  {
    return a(this.j, parame);
  }
  
  private boolean a(t paramt, e parame)
  {
    t localt1 = a().a().v(parame);
    t localt2 = new t(localt1.d() - 1.0E-006D, localt1.e() - 1.0E-006D, localt1.b() + 2.0E-006D, localt1.c() + 2.0E-006D);
    return localt2.b(paramt);
  }
  
  private e a(List paramList1, List paramList2)
  {
    boolean bool = sb.e;
    Iterator localIterator = paramList2.iterator();
    while (localIterator.hasNext())
    {
      e locale = (e)localIterator.next();
      if (!this.m.e(locale))
      {
        if (!bool) {
          if (!paramList1.contains(locale)) {
            return locale;
          }
        }
        if (!bool) {
          if (paramList1.contains(b().d().e())) {
            return locale;
          }
        }
      }
    }
    return null;
  }
  
  private e b(List paramList1, List paramList2)
  {
    boolean bool = sb.e;
    Iterator localIterator = paramList1.iterator();
    while (localIterator.hasNext())
    {
      e locale = (e)localIterator.next();
      if (!this.m.e(locale)) {
        if (!bool) {
          if (!paramList2.contains(locale)) {
            return locale;
          }
        }
      }
    }
    return null;
  }
  
  private List b(mb parammb)
  {
    return (List)parammb.a(nb.a);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.l.a.vb

 * JD-Core Version:    0.7.0.1

 */